<template>
	<!-- 查看订单信息 -->
	<view class="container">
		<!-- 订单详情 -->
		<view class="order-details">
			<text class="title">订单详情</text>
			<view class="detail-item">
				<text class="label">预约状态</text>
				<text class="value status">待使用</text>
			</view>
			<view class="detail-item">
				<text class="label">预约时间</text>
				<text class="value important">2024-05-22 13:30</text>
			</view>
			<view class="detail-item">
				<text class="label">预约人</text>
				<text class="value">蒙娜丽莎</text>
			</view>
			<view class="detail-item">
				<text class="label">手机号</text>
				<text class="value">188****5505</text>
			</view>
			<view class="detail-item">
				<text class="label">订单编号</text>
				<text class="value">209387166547326278</text>
			</view>
			<view class="detail-item">
				<text class="label">下单时间</text>
				<text class="value">2024-05-22 13:30</text>
			</view>
		</view>

		<!-- 预约服务 -->
		<view class="service-section">
			<view class="section-title">
				<text class="title-text">预约服务</text>
			</view>
			<u-line></u-line>
			<view class="service-item-box">
				<image class="service-img" style="width: 100%,height:100%;" src="../../static/联系客服_slices/位图@2x.png">
				</image>
				<view class="service-details">
					<view class="service-title-row">
						<text class="service-title">按摩 脊柱侧弯 正骨调理</text>
						<text class="service-type">鲍医师</text>
					</view>
					<view class="service-time">预约时间: 2024-05-22 13:30</view>
					<view class="service-duration">服务时长: 60分钟</view>
					<view class="service-price">
						<text class="current-price">¥598</text>
						<text class="original-price">¥7176</text>
					</view>
				</view>
			</view>
		</view>

       <u-modal :show="show" @cancel="cancel" @confirm="confirm" title="提示":showCancelButton="true">
         <view class="modal-content">
           <view class="message">是否取消订单</view>
        
         </view>
       </u-modal>
		<!-- 操作按钮 -->
		<view class="action-buttons">
			<view class="contact-btn" @click="contactMerchant">
				<u-icon name="phone" size="40"></u-icon>
				<text>联系商家</text>
			</view>
			<view class="price-info">支付金额 ¥598</view>
			<view class="button-row">
				<button class="cancel-btn" @click="cancelOrder">取消订单</button>
				<button class="verify-btn" @click="checkVerificationCode">查看核销码</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show:false, //是否取消订单弹出框
				
			};
		},
		methods: {
			contactMerchant() {
				uni.makePhoneCall({
					phoneNumber: '888888999999',
					success: function() {
						console.log('拨打电话成功');
					},
					fail: function(err) {
						console.error('拨打电话失败', err);
					}
				});

			},
			cancelOrder() {
				this.show=true
				// 取消订单逻辑
			},
			checkVerificationCode() {
				// 查看核销码逻辑
			},
			cancel(){
					this.show=false
			},
			confirm(){
					this.show=false
			}
			
            

		},
	};
</script>

<style scoped>
	.container {

		background-color: #f5f5f5;
		width: 100%;
	}

	.order-details,
	.service-info {
		margin-top: 20rpx;
		background-color: #fff;
		padding: 20rpx;
		border-radius: 8rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
		width: 100%;
	}

	.title {
		font-family: SourceHanSansCN, SourceHanSansCN;
		font-weight: 500;
		font-size: 32rpx;
		color: #202022;
		line-height: 48rpx;
		text-align: left;
		font-style: normal;

	}

	.section-title {
		margin-top: 20rpx;
		padding-bottom: 8rpx;
		color: #333;
		font-weight: bold;
	}

	.detail-item {
		display: flex;
		justify-content: space-between;
		padding: 20rpx 0;
		border-bottom: 1px solid #eee;
	}

	.detail-item:last-child {
		border-bottom: none;
	}

	.label {
		color: #999;
		font-size: 28rpx;
	}

	.value {
		color: #333;
		font-size: 28rpx;
	}

	.important {
		color: #d4af37;
	}

	.status {
		color: #d4af37;
	}

	.service-info {
		display: flex;
		align-items: center;
	}

	.service-img {
		width: 160rpx;
		height: 120rpx;
		margin-right: 20rpx;
		border-radius: 10rpx;
	}

	.service-details {
		flex: 1;
	}

	.service-title-row {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.service-title {
		font-size: 30rpx;
		font-weight: bold;
		margin-bottom: 6rpx;
	}

	.service-type {
		background-color: #ffd700;
		color: #fff;
		padding: 2rpx 6rpx;
		border-radius: 4rpx;
		font-size: 24rpx;
	}

	.service-time,
	.service-duration {
		color: #888;
		font-size: 26rpx;
	}

	.service-price {
		display: flex;
		align-items: baseline;
		margin-top: 6rpx;
	}

	.current-price {
		font-size: 34rpx;
		color: #d4af37;
		margin-right: 10rpx;
	}

	.original-price {
		font-size: 26rpx;
		color: #888;
		text-decoration: line-through;
	}

	.action-buttons {
		margin-top: 30rpx;
		width: 100%;
	}

	.contact-btn {
		display: flex;
		justify-content: center;
		align-items: center;
		padding: 16rpx;
		font-size: 32rpx;
		color: #d4af37;
		background-color: white;
	}

	.price-info {
		font-size: 32rpx;
		color: #333;
		text-align: center;
		margin: 20rpx 0;
	}

	.button-row {
		display: flex;
		justify-content: space-between;
	}

	.cancel-btn,
	.verify-btn {
		flex: 1;
		margin: 0 18px;
		/* padding: 8px 0; */
		font-size: 15px;
		text-align: center;
		border-radius: 4px;
	}

	.cancel-btn {
		background-color: #ccc;
		color: #fff;
	}

	.verify-btn {
		background-color: #d4af37;
		color: #fff;
	}

	.service-section {
		margin-top: 20rpx;
		background-color: #fff;
		padding: 20rpx;
		border-radius: 8rpx;
		box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
		width: 100%;
		box-sizing: border-box;
	}

	.section-title {
		padding-bottom: 10rpx;
		margin-bottom: 20rpx;
	}

	.title-text {
		color: #333;
		font-weight: bold;
	}

	.service-item-box {
		display: flex;
		align-items: center;
		padding: 6px;
		background: #f0f4ff;

		margin-top: 15px;
		border-radius: 10px;
	}


	.service-img {
		width: 160rpx;
		height: 120rpx;
		margin-right: 20rpx;
		border-radius: 10rpx;
	}

	.service-details {
		flex: 1;
	}

	.service-title-row {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.service-title {
		font-size: 28rpx;
		font-weight: bold;
		margin-bottom: 6rpx;
	}

	.service-type {
		background-color: #e0e0e0;
		color: #666;
		padding: 2rpx 6rpx;
		border-radius: 4rpx;
		font-size: 24rpx;
	}

	.service-time,
	.service-duration {
		color: #888;
		font-size: 24rpx;
	}

	.service-price {
		display: flex;
		align-items: baseline;
		margin-top: 6rpx;
	}

	.current-price {
		font-size: 34rpx;
		color: #d4af37;
		margin-right: 10rpx;
	}

	.original-price {
		font-size: 24rpx;
		color: #888;
		text-decoration: line-through;
	}

	/deep/.u-icon__icon {
		font-family: uicon-iconfont;
		position: relative;
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-top: 2px;
	}
</style>